package com.rd.p2p.mobile.recharge;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ModelDriven;
import com.qdlc.p2p.biz.service.AccountRechargeService;
import com.qdlc.p2p.biz.service.AccountService;
import com.qdlc.p2p.biz.service.UserIdentifyService;
import com.qdlc.p2p.biz.web.action.BaseAction;
import com.qdlc.p2p.dal.dto.Account;
import com.qdlc.p2p.dal.dto.User;
import com.qdlc.p2p.dal.model.AccountRechargeModel;

/**
 * 充值
 * 
 * @author wuhuan
 */
public class MobileRechargeAction extends BaseAction<AccountRechargeModel> implements ModelDriven<AccountRechargeModel> {

	@Resource 
	private AccountService  accountService;

	/**
	 * 充值
	 */
	@Action(value = "/mobile/usercenter/recharge/newRecharge", results = {
			@Result(name = "newRecharge", type = "ftl", location = "/mobile/member/recharge/newRecharge.html") })
	public String newRecharge() throws Exception {
	    saveToken("newRecharge");
	    User user = getSessionUser();
	    Account account = accountService.findAccountByUserId(user.getUserId());
	    request.setAttribute("account", account);
		return "newRecharge";
	}
	
	/**
	 * 快捷支付
	 */
	@Action(value = "/mobile/usercenter/recharge/quickPay", results = {
			@Result(name = "quickPay", type = "ftl", location = "/mobile/member/recharge/quickPay.html") })
	public String quickPay() throws Exception {
		return "quickPay";
	}

}
